from api.basic_api import BaseBuyerApi


class AddMemberAddressApi(BaseBuyerApi):
    def __init__(self):
        super().__init__()
        self.url = f'{self.host}/members/address'
        self.method = 'post'
        self.data = {
                "name": "李李李",
                "addr": "这是一个详细地址",
                "mobile": "18829976655",
                "def_addr": 0,
                "ship_address_name": "这是地址别名",
                "region": 2799
        }

class ChangeMemberAddressApi(BaseBuyerApi):
    def __init__(self,address_id):
        super().__init__()
        self.url = f'{self.host}/members/address/{address_id}'
        self.method = 'put'
        self.data = {
                "name": "李李李",
                "addr": "这是一个详细地址",
                "mobile": "18829976655",
                "def_addr": 0,
                "ship_address_name": "这是地址别名",
                "region": 2799
        }

class DeleteMemberAddressApi(BaseBuyerApi):
    def __init__(self,address_id):
        super().__init__()
        self.url = f'{self.host}/members/address/{address_id}'
        self.method = 'delete'

class SelectMemberAddressApi(BaseBuyerApi):
    def __init__(self,address_id):
        super().__init__()
        self.url = f'{self.host}/members/address/{address_id}'
        self.method = 'get'

class SetMemberAddressDefaultApi(BaseBuyerApi):
    def __init__(self,address_id):
        super().__init__()
        self.url = f'{self.host}/members/address/{address_id}/default'
        self.method = 'put'

class SelectMemberAddressListApi(BaseBuyerApi):
    def __init__(self):
        super().__init__()
        self.url = f'{self.host}/members/addresses'
        self.method = 'get'